package cn.lili.modules.mapper;

import cn.lili.modules.operationcenter.entity.dos.OperationCenter;
import cn.lili.modules.operationcenter.entity.vos.OperationCenterVo;
import cn.lili.modules.urbansubstation.entity.vos.UrbanSubstationVo;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface OperationCenterMapper extends BaseMapper<OperationCenter> {

    @Select("select loc.*, lu.userName, luw.balance from `lilishop_user`.li_operation_center loc " +
            "inner join `lilishop_user`.li_user lu on  loc.user_id = lu.id " +
            "inner join `lilishop_payment`.li_user_wallet luw on loc.user_id = luw.user_id " +
            "${ew.customSqlSegment}")
    Page<OperationCenterVo> findByConditionPage(Page<UrbanSubstationVo> page, @Param(Constants.WRAPPER) Wrapper<OperationCenterVo> queryWrapper);
}
